<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        //注册方法 账号 密码 和 昵称(不传递给与默认值 佚名)
        let login = (account,password,nickname)=>{
            if(typeof nickname == 'undefined'){
                nickname = '佚名'
            }
            return account+password+nickname;
        }

        //es6以后,函数的参数可以直接给与[[默认值]] undefined场景才会触发
        let logines6 = (account,password,nickname="佚名")=>{
            return account+password+nickname;
        }

    </script>
</body>
</html>